package org.bookr.engine.dao;

import org.bookr.engine.model.*;
import org.springframework.security.core.userdetails.UsernameNotFoundException;

import java.util.Set;

/**
 * This is a DAO interface. It enables to access any data stored in database.
 * @author Pawel Tomaszewski
 */
public interface BookrDao {

    /**
     * Fetches all <code>Administrator</code>s from data store.
     * @return set of all <code>Administrator</code>s
     */
    Set<Administrator> getAdministrators();
    Administrator getAdministratorById(String id);
    Administrator getAdministatorByUsername(String username);
//    String saveAdministrator(Administrator administrator);
    void deleteAdministrator(Administrator administrator);
    String updateAdministrator(Administrator administrator);

    Set<Author> getAuthors();
    Author getAuthor(String id);
//    String saveAuthor(Author author);
    void deleteAuthor(Author author);
    String updateAuthor(Author author);

    Set<Book> getBooks();
    Book getBook(String id);
//    String saveBook(Book book);
    void deleteBook(Book book);
    String updateBook(Book book);

    Set<Category> getCategories();
    Category getCategory(String id);
//    String saveCategory(Category category);
    void deleteCategory(Category category);
    String updateCategory(Category category);

    Set<Comment> getComments();
    Comment getComment(String id);
//    String saveComment(Comment comment);
    void deleteComment(Comment comment);
    String updateComment(Comment comment);

    Set<Group> getGroups();
    Group getGroup(String id);
//    String saveGroup(Group group);
    void deleteGroup(Group group);
    String updateGroup(Group group);

    Set<Reader> getReaders();
    Reader getReaderById(String id);
    Reader getReaderByUsername(String username);
//    String saveReader(Reader reader);
    void deleteReader(Reader reader);
    String updateReader(Reader reader);
}
